package cn.edu.scau.cmi.yanghaorui.client;

import java.util.Scanner;

import cn.edu.scau.cmi.yanghaorui.abstractFactory.domainAbstractClass.Meat;
import cn.edu.scau.cmi.yanghaorui.abstractFactory.factory.AbstractFactory;
import cn.edu.scau.cmi.yanghaorui.abstractFactory.factory.AonongFactory;
import cn.edu.scau.cmi.yanghaorui.abstractFactory.factory.TianbangFactory;
import cn.edu.scau.cmi.yanghaorui.abstractFactory.factory.WensFactory;

public class AbstractFactoryClient {

	public static void main(String[] args) {
		//while(true) {
			System.out.println("Please select which brand you want to buy: wens, tianbang or aonong???");
			Scanner scanner = new Scanner(System.in);  
			String brandKind = scanner.next();  
			AbstractFactory factory=null;
			switch(brandKind){
			case "wens": factory=new WensFactory();break;
			case "tianbang": factory=new TianbangFactory();break;
			case "aonong": factory=new AonongFactory();break;
			default:System.out.println("sorry, your input is not correct");
			
			}
			
//			（2）选择产品
			
			System.out.println("Please select which product you want to buy: beef, pork or chicken???");
//			Scanner scanner = new Scanner(System.in);  
			String productType = scanner.next();  
			Meat meat=null;
			switch(productType) {
			case "beef": meat=factory.createBeef();break;
			case "pork": meat=factory.createPork();break;
			case "chicken": meat=factory.createChicken();break;
			default:System.out.println("sorry, your input is not correct");
			
			}
			if(meat!=null) {
				meat.cook();
			}

			
		//}
		
	}

}
